Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: delete model #134

Merged
merged 5 commits into from
Jan 26, 2024
Merged

feat: delete model #134

merged 5 commits into from
Jan 26, 2024

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Jan 25, 2024

fixes partially #50

@feloy feloy force-pushed the feat-50/manage-models-2 branch 8 times, most recently from 8e3d2ce to 408a6d8 Compare January 25, 2024 13:43
this.#deleted.add(modelId);
await this.sendModelsInfo();
try {
await fs.promises.rm(modelDir, { recursive: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recursive option for deleting always scares me, something we could do, is listing all the files inside the model directory, ask user for confirmation something like

"The following files will be deleted

  • model-a.gguff
    "

Then delete them by name instead of deleting the folder ? (I am maybe just overreacting)


<ListItemButtonIcon
icon={faTrash}
onClick={() => deleteModel()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we need confirmation modal

@feloy feloy force-pushed the feat-50/manage-models-2 branch from ce3c39c to 425ef27 Compare January 26, 2024 09:12
@feloy feloy requested a review from axel7083 January 26, 2024 09:12
Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I face this error when trying to delete the model
image

@feloy
Copy link
Contributor Author

feloy commented Jan 26, 2024

I face this error when trying to delete the model image

On Windows, right? I'll have a look

@lstocchi
Copy link
Contributor

On Windows, right? I'll have a look

Yes

@lstocchi
Copy link
Contributor

lstocchi commented Jan 26, 2024

@feloy maybe i got what happened. I had my playground running and i tried to delete the model 🤔 I'll try again, but we should inform the user in this case.

UPDATE: I confirm. It works fine when the model is not used.

@feloy
Copy link
Contributor Author

feloy commented Jan 26, 2024

@feloy maybe i got what happened. I had my playground running and i tried to delete the model 🤔 I'll try again, but we should inform the user in this case

Yes, I would like to display the error message to the user in this case, but for now, AI Studio doesn't have a clear way to display errors coming from the backend (as the call is async, we cannot get the error as the result from a call to a deleteModel).

@jeffmaury what do you think? Do we want to implement a generic error handler (kind of notifications), something else?

@lstocchi
Copy link
Contributor

@feloy maybe i got what happened. I had my playground running and i tried to delete the model 🤔 I'll try again, but we should inform the user in this case

Yes, I would like to display the error message to the user in this case, but for now, AI Studio doesn't have a clear way to display errors coming from the backend (as the call is async, we cannot get the error as the result from a call to a deleteModel).

@jeffmaury what do you think? Do we want to implement a generic error handler (kind of notifications), something else?

I saw Axel just pushed #152 . Maybe adding a task to the taksmanager and an error icon next to the delete icon that opens up the task manager?

@feloy feloy force-pushed the feat-50/manage-models-2 branch 4 times, most recently from 91d14a9 to 72db6d8 Compare January 26, 2024 12:10
@feloy feloy requested a review from lstocchi January 26, 2024 12:21
@feloy feloy force-pushed the feat-50/manage-models-2 branch from 72db6d8 to 9861dc9 Compare January 26, 2024 12:21
Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried again, now the error is displayed on a dialog. Thanks!

@feloy feloy force-pushed the feat-50/manage-models-2 branch from 9861dc9 to 1aa5701 Compare January 26, 2024 15:42
@feloy feloy merged commit 2c9fa67 into main Jan 26, 2024
3 checks passed
@feloy feloy deleted the feat-50/manage-models-2 branch January 26, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants